<%
  @portal_style = terminal_merchant.portal_style
  @banners = @portal_style.banners
%>

<div class="container">
  <div class="row mbot30">
    <div class="col-lg-5 col-xs-12 col-centered">
    <%= render partial: "partial/adv", locals: { title: "登录界面" } %>
    <div class="row span5 col-centered broadcast">
      <%= image_tag 'tu_03_03.png' %> <span>热门活动</span>
    </div>
    <div class="row span5 col-centered" style="margin-top:5px; margin-bottom: 5px; background-color: #f1eddf;">
    <%= simple_form_for :account, as: :post, url:  sign_in_wifi_users_path,:role => "form", html: { class: "form-signin" } do |f| %>

      <div style="padding:5px 10px;">
        <%= f.input_field :mobile, :autofocus => true, class: "form-control input-lg", placeholder: "手机", value: params[:account][:mobile] %>
      </div>

      <div class="form-group" style="padding:3px 10px;margin-bottom:10px;">
        <div class="row">
          <div class=" col-xs-7 col-sm-7 col-lg-7">
            <%= f.input_field :verify_code, class: "form-control input-lg", placeholder: "验证码" %>
          </div>
          <div class="col-xs-5 col-sm-5 col-lg-5" style="padding-left:0px;padding-top:5px;">
            <a class="btn btn-info" id="send_message">获取验证码</a>
          </div>
        </div>
      </div>
      <div class="row span5 col-centered" style="font-weight:100;color:#797979;font-size:13px;letter-spacing: 0.2em;">
        <div class="col-lg-offset-2 col-xs-offset-2">
          <div class="checkboxes">
            <label class="label_check" for="disclaimer_check">
            <input name="disclaimer_check" id="disclaimer_check" value="1" type="checkbox"> 我已阅读<span data-toggle="modal" data-target="#myModal" style="color:#067EC0">免责声明</span>并同意。</label>
          </div>
        </div>
      </div>
      <%= f.hidden_field :vtoken, value: params[:vtoken] %>
      <div class="row span5 col-centered text-center" style="margin-top:2px;">
        <%= f.submit "登录", class: "btn btn-info btn-lg sign_in", style: "width:50%;letter-spacing: 0.8em;" %>
      </div>

    <% end %>
    </div>

    <%= form_tag quick_login_wifi_users_path, method: 'post' do %>
      <%= hidden_field_tag :mid, params[:mid] %>
      <%= hidden_field_tag :vtoken, params[:vtoken] %>
      <%= submit_tag '直接登录', class: "btn btn-lg btn-success col-sm-12 col-xs-12 col-lg-12 col-md-12", style: "margin-top: 2%;"%>
    <% end %>

    <div class="row span5 col-centered " style="color:#514625;background-color:#eecd77;padding:5px 10px;margin-top:15px;">
      其它登录方式
    </div>
    <div class="row span5 col-centered center-block" style="background-color:#e8e08a">
      <div class="col-lg-1 col-xs-1"></div>
      <div class="col-lg-3 col-xs-3" style="">
        <div class="vf-box">
          <%= image_tag "tu_03_25.png"%>
        </div>
      </div>
      <div class="col-lg-3 col-xs-3" style="">
        <div class="vf-box">
          <%= image_tag "tu_03_27.png"%>
        </div>
      </div>
      <div class="col-lg-3 col-xs-3" style="">
        <div class="vf-box">
          <%= image_tag "tu_03_29.png"%>
        </div>
      </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel"> 免责声明</h4>
          </div>
          <div class="modal-body">
            <p>尊敬的用户：您在使用视网魔免费提供的免费无线上网服务时，请保护好您的个人信息与资料，以免被他人非法获得或使用；请遵守国家相关法律法规规定，不访问非法、不良网站及发表、传输任何违法信息。您在网络上泄露个人信息资料，或者访问非法、不良网站及发表、传输任何违法信息而导致的相关损失与责任，均由您自行承担，视网魔对此不承担任何责任。
            </p>
          </div>
        </div>
      </div>
    </div>

</div>

<%= javascript_tag do %>
  $( document ).ready(function() {
    $(".sign_in").click(function(){
      if($("label[for$='disclaimer_check']").prop("class").indexOf("c_on") >= 0){
        return true;
      }
      else{
        alert('请确认同意免责声明。'); return false;
      }
    })
  })
<% end %>
